package hbr.vedio;

import hbr.vedio.x163.X163;

import java.util.List;
import java.util.Map;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.MapListHandler;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import util.Db;

public class Go {

	public static void main(String[] args) throws Exception {

		QueryRunner qr = new QueryRunner(Db.ds);
		String sql = "select id,f_url from video where title is null  ";
		List<Map<String, Object>> ls = qr.query(sql, new MapListHandler());
		for (Map<String, Object> m : ls) {
			int id = (Integer) m.get("id");
			String f_url = (String) m.get("f_url");
			System.out.println(f_url);
			X163 x = new X163();

			V v = x.go(f_url);
			qr.update("update video  set  title =? , eps = ? , list = ?  ,content =?  where id =?  ", v.title, v.eps, v.list+"|", v.content, id);

		}

	}

}
